using System;
using System.Collections.Generic;
using System.Text;

namespace Eve.Data
{
    public class AgentConfig : EveAssociation<Agent, string>
    {
        private string v;

        public Agent Agent
        {
            get { return From; }
        }
        public string Key
        {
            get { return To; }
        }
        public string Value
        {
            get { return v; }
        }

        internal AgentConfig(DbDataRow dr)
            : base(dr.Database, new Agent(dr.Database, dr["agentID"]), dr["k"])
        {
            Fill(dr);
        }
        internal AgentConfig(DbDataRow dr, Agent agent)
            : base(dr.Database, agent, dr["k"])
        {
            Fill(dr);
        }

        private void Fill(DbDataRow dr)
        {
            v = dr["v"];
        }
    }
}
